# -*- coding: utf-8 -*-
'''
Created on 2012-1-15

@author: y
'''


from django import forms
from django.contrib.auth.models import User
from django.forms import ModelForm
from django.forms.widgets import TextInput
from sprt.admin.models import Dept, Holiday, Workday


class CreateDeptForm(forms.Form):
    name = forms.CharField(max_length=45, label=u'部门名称')
    superior_dept_id=forms.ModelChoiceField(label=u'上级部门',queryset=Dept.objects.all(),empty_label=u'无上级部门',required=False,initial=0)
    principal_auth_user_id=forms.ModelChoiceField(label=u'负责人',queryset=User.objects.all())



class HolidayForm(ModelForm):
    start_date = forms.DateField(label=u'开始时间')
    end_date = forms.DateField(label=u'结束时间')
    memo = forms.CharField(label=u'备注',widget=TextInput(attrs={'size': 30}))
    class Meta:
        model = Holiday
        fields = ('start_date','end_date', 'memo',)
        
class WorkdayForm(ModelForm):
    at_date = forms.DateField(label=u'工作日')
    memo = forms.CharField(label=u'备注',widget=TextInput(attrs={'size':30}))
    class Meta:
        model = Workday
        fields =('at_date','memo',)